/****************************************************
          File Name:array_sequence_queue.c
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 09 Feb 2015 09:43:37 PM CST
*****************************************************/

#include <stdio.h>
#include <stdlib.h>
#include "array_sequence_queue.h"

int main(int argc, char *argv[])
{
    Queue q;
    mydata data;

    InitQueue(&q);
    printf("enQueue\n");
    for(int i=0; i<QUEUE_MAX; i++)
    {
        printf("enter a number: ");
        scanf("%d", &data);
        if(!EnQueue(&q, data))
        {
            printf("EnQueue failed\n");
            exit(1);
        }
    }

    printf("Queue Length: %d\n", QueueLength(&q));
    printf("deQueue\n");
    for(int i=0; i<QUEUE_MAX; i++)
    {
        if(!DeQueue(&q, &data))
        {
            printf("QeQueue failed\n");
            exit(1);
        }
        printf("\t\tdequeue: %d\n", data);
    }
    printf("Queue Length: %d\n", QueueLength(&q));

    return 0;
}
